// http://162.14.108.31:3000/api/sessions/code/12334567876
import Api from './common-api'
import Axios from './userAjax'
/**
 * 获取验证码
 * @param {*} phone
 * @returns  code
 */
function getCodeApi (phone) {
  return Axios({
    url: Api.CODE_API + '/' + phone,
    method: 'GET'
  })
}
/**
 * 用户登录接口
 * @param {*} req
 * @returns
 */
function loginApi (req) {
  console.log(req, 'req:')
  return Axios({
    url: Api.SESSION_API,
    method: 'POST',
    data: {
      phone: req.phone,
      code: req.code
    }
  })
}
export {
  getCodeApi,
  loginApi
}
